package com.example.mq.rabbitmq.rabbit;

import cn.hutool.json.JSONUtil;
import com.example.mq.rabbitmq.config.RabbitMQTopicConfig;
import com.example.mq.rabbitmq.po.Message;
import com.example.mq.rabbitmq.po.TestMessage;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author xyh
 * @description
 * @date 2021/3/31 16:40
 */
@Component
public class RabbitConsumer2 {

    @RabbitListener(queues = RabbitMQTopicConfig.sencond_queue)
    public void process(Message<TestMessage> message){
        System.out.println("RabbitConsumer2:"+JSONUtil.toJsonStr(message));
    }
}
